package com.yuyou.fn.common.util;

import java.util.regex.Pattern;

/**
 * @Author: weiwenfeng
 * @Date: 2018/10/22
 */
public class RegexUtils {

    public static final String REGEX_PHONE_SIMPLE = "^[1]\\d{10}$";

    public static boolean isPhone(String input){
        return isMatch(REGEX_PHONE_SIMPLE,input);
    }

    /**
     * @param regex 正则表达式
     * @param input 要匹配的字符串
     * @return
     */
    public static boolean isMatch(String regex,CharSequence input){
        return input != null && input.length() > 0 && Pattern.matches(regex, input);
    }
}
